import './style.less';
const AlgoNode = (props: any) => {
  const { node } = props;
  const data = node?.getData();
  const { label, status = 'default', imgURL } = data;
  const image = {
    logo: '/images/yunzhuan.png',
    success:
      'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*6l60T6h8TTQAAAAAAAAAAAAAARQnAQ',
    failed: 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*SEISQ6My-HoAAAAAAAAAAAAAARQnAQ',
    running:
      'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*t8fURKfgSOgAAAAAAAAAAAAAARQnAQ',
  };
  return (
    <div className={`node ${status}`}>
      <img src={imgURL} alt="logo" />
      <span className="label">{label}</span>
      <span className="status">
        {status === 'success' && <img src={image.success} alt="success" />}
        {status === 'failed' && <img src={image.failed} alt="failed" />}
        {status === 'running' && <img src={image.running} alt="running" />}
      </span>
    </div>
  );
};

export default AlgoNode;
